home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8249 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net   (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: *** Need help ASAP *** CLS, LOCATE, etc do not work with Borland 3.1 for dos
  5. Date: 2 Mar 1996 18:11:05 GMT
  6. Organization: Nando.net Public Access
  7. Message-ID: <4ha2vp$6a8@castle.nando.net>
  8. References: <4h96ne$3nb@fountain.mindlink.net>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: vyger117.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4h96ne$3nb@fountain.mindlink.net>, mike_huwe@mindlink.bc.ca (Mike Huwe) writes:
  14. >I am using Borland C++ 3.1. When I run simple programs that clear the
  15. >screen or use the LOCATE command, they don't work. for example,
  16. >When I run a program the output stays at the top of the screen. When I run
  17. >the program again the new output is shown below the old output.
  18. >
  19. >If I use the LOCATE macro, the statements are printed below
  20. >each other rather than at the specified cursor location.
  21. >
  22. >Does anyone know what the problem is?
  23. >
  24. >Please e-mail me with your responses. Thanks in advance.
  25. >
  26. >Mike
  27. >
  28. >I used the following:
  29. >
  30. >#define CLS printf("\033[2j")
  31. >#define LOCATE(r,c) printf("\033[%d;%dH",r,c)
  32.  
  33. The CLS macro should use "J" instead of "j" and make sure ansi video
  34. support is loaded.
  35.  
  36. Also, there are Borland functions to do these things (see conio.h).
  37. However, the macro approach works with other compilers and work
  38. in DOS and dos shells like Windows.  Once you buy your first 32 bit
  39. computer, it will also work with OS/2 or WinNT.
  40.  
  41. Bill McCarthy
  42. actuary@nando.net
  43. Wendell, NC  USA
  44.  
  45.